package vietnam.traveltools.view;

import vietnam.traveltools.R;
import vietnam.traveltools.TravelActivity;
import vietnam.traveltools.variables.ListItem;
import android.app.Service;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

public class TravelView extends LinearLayout {
	public TextView tvName;
	public TextView tvCity;
	public TextView tvPrice;
	public TextView tvAddress;
	public TextView tvDescription;
	public LinearLayout lnTravel;
	public TextView tvID;

	public TravelView(Context context) {
		super(context);

		LayoutInflater linflater = (LayoutInflater) ((TravelActivity) context)
				.getSystemService(Service.LAYOUT_INFLATER_SERVICE);
		linflater.inflate(R.layout.item_travel_layout, this);

		this.tvName = (TextView) findViewById(R.id.tvName);
		this.tvPrice = (TextView) findViewById(R.id.tvPrice);
		this.tvDescription = (TextView) findViewById(R.id.tvDescription);
		this.tvCity = (TextView) findViewById(R.id.tvCity);
		this.tvAddress = (TextView) findViewById(R.id.tvAddress);
		this.lnTravel = (LinearLayout) findViewById(R.id.lnTravel);
		this.tvID = (TextView) findViewById(R.id.tvID);
	}

	public void setListItem(ListItem item) {

		this.tvPrice.setText(item._price);
		this.tvCity.setText(item._city);
		this.tvName.setText(item._name);
		this.tvAddress.setText(item._address);
		this.tvDescription.setText(item._description);
		this.tvID.setText(item._id_travel);
	}

}
